<template>
	<div class="custom-form">
		<el-row :gutter="15">
			<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey"
				v-if="showForm">
				<el-col :span="24" v-show="hasFormPermission('class_id')">
					<el-form-item :label="$t('上级分类')" prop="class_id">
						<avue-input-tree ref="tree" default-expand-all v-model="formData.class_id"
							:placeholder="请选择上级分类" type="tree" :dic="class_idOptions" :props="defaultProps"
							size="medium" @change="handlerSelectclass_id"></avue-input-tree>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="hasFormPermission('class_complete_code')">
					<el-form-item :label="$t('产品分类代码')" prop="class_complete_code">
						<el-input v-model="formData['class_complete_code']" placeholder="请输入产品分类代码"
							:disabled="hasDisabledPermission('class_complete_code',false)"
							:readonly="!hasEditPermission('class_complete_code',true)" :style="{width: '100%'}">
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="false">
					<el-form-item :label="$t('产品分类名称（隐藏）')" prop="class_name">
						<el-input v-model="formData['class_name']" placeholder="请输入产品分类名称（隐藏）"
							:disabled="hasDisabledPermission('class_name',false)"
							:readonly="!hasEditPermission('class_name',true)" :style="{width: '100%'}"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="hasFormPermission('internal_code')" >
					<el-form-item :label="$t('企业内部代码')" prop="internal_code">
						<el-input v-model="formData['internal_code']" placeholder="请输入企业内部代码"
							:disabled="hasDisabledPermission('internal_code',false)"
							:readonly="!hasEditPermission('internal_code',false)" :style="{width: '100%'}"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="hasFormPermission('name')">
					<el-form-item :label="$t('产品名称')" prop="name">
						<el-input v-model="formData['name']" placeholder="请输入产品名称"
							:disabled="hasDisabledPermission('name',false)" :readonly="!hasEditPermission('name',false)"
							clearable :style="{width: '100%'}"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="hasFormPermission('specifications')">
					<el-form-item :label="$t('产品规格')" prop="specifications">
						<el-input v-model="formData['specifications']" placeholder="请输入产品规格"
							:disabled="hasDisabledPermission('specifications',false)"
							:readonly="!hasEditPermission('specifications',false)" clearable :style="{width: '100%'}">
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="hasFormPermission('unit')">
					<el-form-item :label="$t('计量单位')" prop="unit">
						<el-input v-model="formData['unit']" placeholder="请输入计量单位"
							:disabled="hasDisabledPermission('unit',false)" :readonly="!hasEditPermission('unit',false)"
							clearable :style="{width: '100%'}"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-show="hasFormPermission('images')">
					<el-form-item :label="$t('产品图片')" prop="images">
						<xjr-custom-upload :config="imagesConfig" :disabled="hasDisabledPermission('images',false)"
							v-model="formData['images']" list-type="picture-card"></xjr-custom-upload>
					</el-form-item>
				</el-col>
				<el-col :span="8" v-show="hasFormPermission('open_to_product_factory')">
					<el-form-item label-width="120px" :label="$t('产品开放给整椅厂')" prop="open_to_product_factory">
						<el-switch v-model="formData['open_to_product_factory']"
							:disabled="hasDisabledPermission('open_to_product_factory',false)"
							:readonly="!hasEditPermission('open_to_product_factory',undefined)" :active-value='1'
							:inactive-value='0'></el-switch>
					</el-form-item>
				</el-col>
				<el-col :span="8" v-show="hasFormPermission('open_to_accessories_factory')">
					<el-form-item label-width="140px" :label="$t('产品开放给配件/材料厂')" prop="open_to_accessories_factory">
						<el-switch v-model="formData['open_to_accessories_factory']"
							:disabled="hasDisabledPermission('open_to_accessories_factory',false)"
							:readonly="!hasEditPermission('open_to_accessories_factory',undefined)" :active-value='1'
							:inactive-value='0'></el-switch>
					</el-form-item>
				</el-col>
				<el-col :span="8" v-show="hasFormPermission('open_to_traders')">
					<el-form-item label-width="120px" :label="$t('产品开放给贸易商')" prop="open_to_traders">
						<el-switch v-model="formData['open_to_traders']"
							:disabled="hasDisabledPermission('open_to_traders',false)"
							:readonly="!hasEditPermission('open_to_traders',undefined)" :active-value='1'
							:inactive-value='0'></el-switch>
					</el-form-item>
				</el-col>
				<!-- <el-col :span="24" v-show="hasFormPermission('t_ycode_product_detail')">
          <avue-form v-loading="preloadLoading111" class=" avueFormTitleNoWrap  subTableForm "
            element-loading-text="数据预加载中..." element-loading-spinner="el-icon-loading"
            element-loading-background="rgba(0, 0, 0, 0.7)" :option="option111"
            v-model="t_ycode_product_detail" ref="avueTablet_ycode_product_detail"
            v-show="hasFormPermission('t_ycode_product_detail')" :disabled="disabled" v-if="reRenderSubform">
          </avue-form>
        </el-col> -->
				<el-table :data="t_ycode_product_detail"  border style="width: 100%">
					<el-table-column prop="order_num" label="序号" v-if="false">
					</el-table-column>
					<el-table-column prop="name" label="名称" >
					</el-table-column>
					<el-table-column prop="type" label="类型">
					<template slot-scope="scope">
					    <el-select v-model="scope.row.type" placeholder="Select" disabled>
							<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.F_ItemName"
							:value="item.F_ItemValue"></el-option>
					    </el-select>
					</template>
					</el-table-column>
					<el-table-column prop="unit_name" label="单位">
					</el-table-column>
					<el-table-column label="属性">
						<template slot-scope="scope">
						    <el-input v-model="scope.row.num_value" placeholder="请输入数值" v-if="scope.row.type==1" :disabled="disabled"></el-input>
							<el-input v-model="scope.row.rang_value" placeholder="请输入最小值" v-if="scope.row.type==2" :disabled="disabled"></el-input>
							<el-input v-model="scope.row.rang_value1" placeholder="请输入最大值" v-if="scope.row.type==2" :disabled="disabled"></el-input>
							<el-select v-model="scope.row.boolean_value" placeholder="请选择属性" v-if="scope.row.type==3" :disabled="disabled">
								<el-option v-for="(item, index) in booleanOptions" :key="index" :label="item.F_ItemName"
								:value="item.F_ItemValue" :disabled="item.disabled"></el-option>
							</el-select>
							<el-select v-model="scope.row.single_choice_value" placeholder="请选择属性" v-if="scope.row.type==4" :disabled="disabled">
								<el-option v-for="(item, index) in singleOptions[scope.$index]" :key="index" :label="item.name"
								:value="item.code" :disabled="item.disabled"></el-option>
							</el-select>
							<el-select v-model="scope.row.multiple_choice_value" multiple placeholder="请选择属性" v-if="scope.row.type==5" :disabled="disabled">
							    <el-option v-for="(item, index) in multipleOptions[scope.$index]" :key="index" :label="item.name" :value="item.code">
							    </el-option>
							  </el-select>
							<!-- <el-checkbox-group v-model="t_ycode_product_detail[multiple_choice_value]" v-if="scope.row.type==5">
							    <el-checkbox v-for="(item, index) in multipleOptions" :key="index" :label="item.id":disabled="item.disabled">{{item.name}}</el-checkbox>
							</el-checkbox-group> -->
						</template>
					</el-table-column>
				</el-table>
				<el-col :span="24">
					<el-form-item size="large" v-if="isEdit" class="form-button-center">
						<el-button type="primary" @click="submitForm" :loading="submitLoading">
							{{submitLoading?$t('workFlow.WFMenu.hintSubmit'):$t('submit')}}
						</el-button>
						<el-button @click="cancelForm">{{$t('cancelText')}}</el-button>
					</el-form-item>
				</el-col>
			</el-form>
		</el-row>
	</div>
</template>
<script>
	import authorizeMixin from "@/mixins/authorize";
	import {
		baseUrl
	} from "@/config/env";
	import request from "@/router/axios";
	import {
		fieldsConfig,
		formFieldsMap,
		getHideComponents
	} from './t_ycode_productConfig'
	import {
		formValidateNotice
	} from '@/util/util';
	export default {
		mixins: [authorizeMixin],

		components: {},
		props: ['keyValue', 'isEdit', 'disabled','load'],
		data() {
			return {
				userInfo: {},
				t_ycode_product_detail: [],
				submitLoading: false,
				showForm: true,
				showFormKey: 1,
				reRenderSubform: false,
				operationVal: 'add',
				isAdd: true,
				addressUrl: 't_ycode_product',
				autoCompleteConfEventData: [],
				mainTableName: 't_ycode_product',
				formConfig: {},
				formFieldsMap: new Map(),
				hideComponentsMap: new Map(),
				needShowValueTags: ['asso-popup', 'mutiple-popup'],
				single_choice_value121tableChildDicData: [],
				formData: {
					'class_id': '',
					'class_complete_code': '',
					'class_name': '',
					'name': '',
					'specifications': '',
					'unit': '',
					'images': null,
					'status': '',
					'open_to_product_factory': 0,
					'open_to_accessories_factory': 0,
					'open_to_traders': 0,
					'id': '',
					'internal_code':'',
				},
				defaultProps: {
					label: 'name',
					children: 'children',
					value: 'id',
				},
				rules: {
					class_id: [{
						required: true,
						message: '请选择产品分类名称',
						trigger: 'change'
					}],
					class_complete_code: [],
					class_name: [],
					name: [{
						required: true,
						message: '请输入产品名称',
						trigger: 'blur'
					}],
					specifications: [],
					unit: [{
						required: true,
						message: '请输入计量单位',
						trigger: 'blur'
					}],
					images: [{
						required: true,
						message: '产品图片不能为空',
						trigger: 'change'
					}],
					status: [{
						required: true,
						message: '请选择状态',
						trigger: 'change'
					}],
				},
				class_idOptions: [],
				typeOptions: [],
				booleanOptions:[],
				singleOptions:[],
				multipleOptions:[],
				class_idLoading: false,
				imagesConfig: {
					"showTip": false,
					"fileSize": 2,
					"sizeUnit": "MB",
					"buttonText": "点击上传",
					"disabled": false
				},
				statusOptions: [],
				
				preloadLoading111: false,
			}
		},
		computed: {
			
		},
		watch: {},
		async created() {
			this.formConfig = this.getFormConfig();
			this.formFieldsMap = this.getFormFieldsMap();
			this.userInfo = localStorage.getItem("avue-userInfo") ? JSON.parse(localStorage.getItem(
				"avue-userInfo")).content : {};
		},
		async mounted() {
			this.hideComponentsMap = await this.getHideComponentsMap();
			this.showForm = false;
			await this.insertCreatedEvent();
			//TODO   再这里做数据回填 请求表单数据

			if (this.keyValue) {
				this.isAdd = false;
			}
			if (!this.isAdd && this.keyValue) {
				this.operationVal = 'edit';
				try {
					let res = await request({
						url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
						method: "get",
					});

					this.formData = res.data.data.t_ycode_product;
					request({
						url: baseUrl +
							'/t_ycode_master_data_standard_detail/getStandardCompleteInfo?standard_id=' + res.data.data.t_ycode_product.class_id,
						method: "get",
					}).then((res) => {
						for (var i = 0; i < res.data.data.detailList.length; i++) {							
							if(res.data.data.detailList[i].type == 4){
								this.singleOptions[i] = res.data.data.detailList[i].enmuList;
							}
							if(res.data.data.detailList[i].type == 5){
								this.multipleOptions[i] = res.data.data.detailList[i].enmuList;
							}
						}
					});
					this.t_ycode_product_detail = [];
					console.log(res.data.data.t_ycode_product_detail)
					if(this.load == true){
						for (var i = 0; i < res.data.data.t_ycode_product_detail.length; i++) {
							this.t_ycode_product_detail.push({
								id : res.data.data.t_ycode_product_detail[i].id,
								name: res.data.data.t_ycode_product_detail[i].name,
								type: res.data.data.t_ycode_product_detail[i].type,
								unit_name: res.data.data.t_ycode_product_detail[i].unit_name,
							  num_value: res.data.data.t_ycode_product_detail[i].num_value,
							  rang_value: res.data.data.t_ycode_product_detail[i].rang_value,
							  rang_value1: res.data.data.t_ycode_product_detail[i].rang_value1,
							  boolean_value: res.data.data.t_ycode_product_detail[i].boolean_value,
							  single_choice_value: res.data.data.t_ycode_product_detail[i].single_choice_value,
							  multiple_choice_value: res.data.data.t_ycode_product_detail[i].multiple_choice_value,
							});
						}
						
					}
					console.log(this.t_ycode_product_detail)
					this.t_ycode_product_detail.forEach(element => {
						if (element.multiple_choice_value) {
							element.multiple_choice_value = element.multiple_choice_value.split(',')
						}

					});

					await this.handleEdit();
					this.showFormKey++;
				} catch (error) {}
			}


			if (typeof this.getField100Options == "function") {
				await this.getField100Options();
			}
			if (typeof this.getField107Options == "function") {
				await this.getField107Options();
			}
			if (typeof this.getbooleanOptions == "function") {
				await this.getbooleanOptions();
			}
			if (this.isAdd) {

			}
			try {
				await this.setTableDicData();
				this.reRenderSubform = true;
			} catch (error) {}
			await this.insertMountedEvent();
			this.reRenderSubform = true; //子表单显示
			this.showFormKey++;
			this.processParameterAssignment();
			this.showForm = true;
		},
		methods: {
			getFormData() {
				let key = this.mainTableName + 'Entity';
				let returnParams = {};
				returnParams[key] = this.formData;
				return {
					...returnParams,
					t_ycode_product_detailEntityList: this.t_ycode_product_detail,
				};
			},
			validateForm() {
				this.$refs['elForm'].validate(valid => {});
			},
			async aysncValidateForm() {
				let validataArry = []
				let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
					for (var o in obj) {
						if (!formAuth[o] && obj[o][0]) {
							that.$message({
								message: obj[o][0].message + ',' + that.$t('noFormAuth'),
								type: 'warning'
							});
							return;
						}
					}
				}
				// if (this.t_ycode_product_detail && this.t_ycode_product_detail
				// 	.length > 0) {
				// 	validataArry.push(new Promise((resolve, reject) => {
				// 		this.$refs['avueTablet_ycode_product_detail'].validate(valid => {
				// 			resolve(valid)
				// 		});
				// 	}));
				// }
				validataArry.push(new Promise((resolve, reject) => {
					this.$refs['elForm'].validate((valid, object) => {
						if (!this.isWorkflowForm) formValidateNotice(object, this, this
							.formEnCodeList)
						resolve(valid)
					})
				}))
				let res = await Promise.all(validataArry)
				if (res.includes(false)) {
					return false
				} else {
					return true;
				}
			},
			changeTableData() {
				if (this.t_ycode_product_detail && this.t_ycode_product_detail
					.length > 0) {
					this.t_ycode_product_detail.forEach((element, index) => {
						let itemChild = {
							...element
						}
						for (let [key, value] of Object.entries(itemChild)) {
							if (Array.isArray(value)) {
								itemChild[key] = value.join(',')
							}
						}
						this.t_ycode_product_detail[index] = itemChild;
					});
				} else {
					this.t_ycode_product_detail = [];
				}
			},
			async submitForm() {
				// console.log(this.t_ycode_product_detail)
				// console.log(this.listData)
				this.submitLoading = true;
				let valid = await this.aysncValidateForm();
				if (valid == false) {
					this.submitLoading = false;
					return false;
				}
				this.changeTableData();
				//格式化数据
				let newObj = this.getFormData();

				//如果没有传入参数就是新增
				if (!this.keyValue) {

					request({
						url: baseUrl + "/" + this.addressUrl,
						method: "post",
						data: newObj
					}).then((res) => {
						this.submitLoading = false;
						this.$notify({
							title: "成功",
							message: "新增成功",
							type: "success",
						});
						this.$emit("onChange", true)
					});

				} else {

					request({
						url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
						method: "put",
						data: newObj
					}).then((res) => {
						this.submitLoading = false;
						this.$notify({
							title: "成功",
							message: "修改成功",
							type: "success",
						});
						this.$emit("onChange", true)
					});

				}




				await this.handleSubmit();
			},
			cancelForm() {
				this.$emit("onChange", true)
			},
			formatTree(data, valueField, lableField, childField, type) {
				let tree = [];
				data.forEach((node, index) => {
					let newNode = {
						value: node[valueField],
						label: node[lableField],
					};
					if (type) {
						newNode.disabled = node[valueField] == undefined ? true : false
					}
					tree.push(newNode);
					if (node[childField] != null && node[childField].length > 0) {
						newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
							type));
					}
				}, this);
				return tree;
			},

			//辅助编辑 预留方法
			async handleEdit() {
				await this.insertEditEvent();
			},

			//FORM_EVENT_EDIT

			//辅助提交 预留方法
			async handleSubmit() {
				await this.insertSubmitEvent();
			},
			//辅助工作流提交 预留方法
			getHandleSubmitFormEvent() {

			},
			//辅助工作流表单事件 判断 表单事件是否已经执行过
			getisExecutedFormEvent() {
				let key = 'index' + this.$store.state.formParser.workflowFormTabIndexKey;
				return this.$store.state.formParser.isExecutedFormEvent[key] ? this.$store.state.formParser
					.isExecutedFormEvent[key] : false;

			},
			async getField100Options(query) {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				let keyword = ' ';
				if (query) {
					keyword = query;
				}
				if (query !== '') {
					this.Field100OptionsLoading = true;
				}
				try {
					let resp = await
					this.$axios({
						method: 'get',
						url: baseUrl + '/t_ycode_class/getClassificationTree' +
							keyword
						//  url:  baseUrl + '/data-sources/0515cced433fc08af78e29cc18e55f2d/data/?field=name&keyword=' +
						// keyword
					});

					this.Field100OptionsLoading = false;
					this.class_idOptions = resp.data.data;

				} catch (error) {}
			},
			handlerSelectclass_id(value) {
				if (value&&this.load == false) {
					request({
						url: baseUrl +
							'/t_ycode_master_data_standard_detail/getStandardCompleteInfo?standard_id=' + value,
						method: "get",
					}).then((res) => {
						this.formData.class_complete_code = res.data.data.standard.completeCode;
						this.t_ycode_product_detail = [];
						for (var i = 0; i < res.data.data.detailList.length; i++) {							
							// this.t_ycode_product_detail[i].name = res.data.data.detailList[i].name;
								this.t_ycode_product_detail.push({
								  order_num:res.data.data.detailList[i].order_num,
								  name: res.data.data.detailList[i].name,
								  type: res.data.data.detailList[i].type,
								  unit_name: res.data.data.detailList[i].unit_name,
								});
							if(res.data.data.detailList[i].type == 4){
								this.singleOptions[i] = res.data.data.detailList[i].enmuList;
							}
							if(res.data.data.detailList[i].type == 5){
								this.multipleOptions[i]=res.data.data.detailList[i].enmuList;
								// let a =this.multipleOptions.map((item,index)=>{
									
								// })
								// console.log(a)
							}
						}
					});
				}
			},
			async getField107Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/ycode_product_status/detail',
					});
					if (resp.data.data) {
						this.statusOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async getbooleanOptions(){
				try {
				        let resp = await this.$axios({
				          method: 'get',
				          url: baseUrl + '/data-items/YesOrNo/detail',
				        });
				        if (resp.data.data) {
				          this.booleanOptions = resp.data.data;
				        }
				      }
				      catch (error) {}
			},
			async setTableDicData() {
				try {
				let resp = await this.$axios({
					method: 'get',
					url: baseUrl + '/data-items/master_data_standard_type/detail',
				});
				if (resp.data.data) {
					this.typeOptions = resp.data.data;
				}
			   }catch (error) {}
			},
			async triggerEventHandler(eventData) {
				if (eventData.length > 0) {
					eventData.forEach(ele => {
						let functionName = 'getField' + ele.componentFormId + 'Options';
						if (typeof this[functionName] == "function") {
							this[functionName]();
						}
					})
				}
			},
			triggerEventFormIdHandler(formId) {
				if (this.formFieldsMap.get(formId).__config__.triggerEvents && this.formFieldsMap.get(formId).__config__
					.triggerEvents.length > 0) {
					this.formFieldsMap.get(formId).__config__.triggerEvents.forEach(triggerEventItem => {
						if (this.formFieldsMap.get(formId).__config__.triggerEventData && this.formFieldsMap.get(
								formId)
							.__config__.triggerEventData[triggerEventItem] && this.formFieldsMap.get(formId)
							.__config__
							.triggerEventData[triggerEventItem].length > 0) {
							this.triggerEventHandler(this.formFieldsMap.get(formId).__config__.triggerEventData[
								triggerEventItem]);
						}
					});
				}
				return true;
			},
			//清空联想弹层、多选弹层的值
			clearBombLayerFormData(filed) {
				this.formData[filed] = '';
				this.formData[filed + '_showValue'] = '';
			},
			// 流程参数赋值
			processParameterAssignment() {
				// 流程中的流程参数赋值 优先级最高，最后赋值
				setTimeout(() => {
					if (this.isEdit != 2 && this.parameter && this.parameter[this.mainTableName]) {
						this.showForm = false;
						for (let [key, value] of Object.entries(this.parameter[this.mainTableName])) {
							this.setFormDataValue(key, value);
						}
						this.showForm = true;
					}
				}, 0);
			},
			setFormDataValue(field, val) {
				if (Array.isArray(this.formData[field])) {
					if (val.includes(',')) {
						this.formData[field] = val.split(',');
					} else {
						this.formData[field] = [val];
					}
				} else {
					this.formData[field] = val;
				}
				//处理联想弹层，多选弹层
				if (this.formData[field + '_showValue'] != undefined) {
					this.formData[field + '_showValue'] = val;
				}
			},
			setOutputsValue(nodeType, formId, res, outputKey) {
				let nodeTypeChecked = false;
				if (nodeType == 'created') {
					nodeTypeChecked = this.operationVal == 'add';
				} else if (nodeType == 'edit') {
					nodeTypeChecked = this.operationVal == 'edit';
				} else if (nodeType == 'mounted') {
					nodeTypeChecked = this.operationVal == 'add' || this.operationVal == 'edit';
				}
				if (nodeTypeChecked && this.disabled != true && res && res.data && res.data.data && this.formFieldsMap
					.has(formId) && this.formFieldsMap.get(formId).__vModel__ && this.formData.hasOwnProperty(this
						.formFieldsMap.get(formId).__vModel__)) {
					this.setFormDataValue(this.formFieldsMap.get(formId).__vModel__, res.data.data[outputKey]);
					// 联想弹层 多选弹层 特殊处理
					if (this.formFieldsMap.get(formId).__config__ && this.formFieldsMap.get(formId).__config__.avueType &&
						this.needShowValueTags.includes(this.formFieldsMap.get(formId).__config__.avueType)) {
						this.formData[this.formFieldsMap.get(formId).__vModel__ + '_showValue'] = res.data.data[outputKey];
					}
					this.triggerEventFormIdHandler(formId);
				}
			},
			//子表单权限
			// getAuthorityTableChildrenList(bindTable, children) {
			// 	let column = [];
			// 	if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
			// 		let formSubEnCodeList = this.formEnCodeList[bindTable];
			// 		if (children && children.length > 0) {
			// 			column = children.map(ele2 => {
			// 				// console.log(children)
			// 				if (formSubEnCodeList.includes(ele2.prop)) {
			// 					// ele2.hide = false;
			// 				} else {
			// 					// ele2.hide = true;
			// 				}
			// 				if (ele2.hide == false) {
			// 					//工作流中系统表单必填权限
			// 					if (this.formSubTableNotRequiredList && this.formSubTableNotRequiredList[
			// 						bindTable] !=
			// 						undefined) {
			// 						if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
			// 							ele2.required = false;
			// 						} else {
			// 							ele2.required = true;
			// 						}
			// 					}
			// 					ele2.rules = [];
			// 					if (ele2.required) {
			// 						ele2.rules = ele2.ruleList;
			// 					}
			// 					// disabled 属性
			// 					if (this.formSubTableDisabledList && this.formSubTableDisabledList[bindTable] !=
			// 						undefined) {
			// 						if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
			// 							ele2.disabled = true;
			// 						} else {
			// 							ele2.disabled = false;
			// 						}
			// 					}
			// 					if (this.disabled) { //查看
			// 						ele2.disabled = true;
			// 					}
			// 				} else {
			// 					ele2.rules = []
			// 					if (ele2.required) {
			// 						ele2.ruleList.forEach(el => {
			// 							el.message += ',' + this.$t('noFormAuth')
			// 						})
			// 						ele2.rules = ele2.ruleList;
			// 					}
			// 				}
			// 				return ele2;
			// 			});
			// 		}
			// 		return column;
			// 	} else {
			// 		return children;
			// 	}
			// },
			// getTableChildrenItemDisabled(bindTable, prop, disabled) {
			// 	if (this.disabled) { //查看
			// 		return true;
			// 	} else if (this.formSubTableDisabledList && this.formSubTableDisabledList[bindTable] != undefined) {
			// 		if (this.formSubTableDisabledList[bindTable].includes(prop)) {
			// 			return true;
			// 		} else {
			// 			return disabled;
			// 		}
			// 	}
			// },
			getTableConfConfig(vmodel) {
				let config = {
					"single_choice_value": {
						"suffix-icon": "",
						"prefix-icon": "",
						"disabled": false,
						"style": {
							"width": "100%"
						},
						"__vModel__": "single_choice_value",
						"__config__": {
							"label": "单选",
							"tag": "el-select",
							"avueType": "select",
							"autoBindFields": "",
							"dataType": "dataItem",
							"dataItem": "master_data_standard_type",
							"dataSource": "",
							"database": "",
							"sql": "",
							"showField": "",
							"saveField": "",
							"apiConfig": {
								"url": "/xjr-interface-info/execute/70771c742bbf772521398673eba92e9d",
								"type": 0,
								"dataSorce": "",
								"dataSorceList": [],
								"dataSourceFieldOption": [],
								"showField": "",
								"saveField": "",
								"apiInputParams": [],
								"F_UrlAddress": "/t_ycode_master_data_standard_detail",
								"apiOutputParams": [],
								"inputList": [{
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "type",
									"F_SettingJson": null,
									"F_Description": null
								}, {
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "name",
									"F_SettingJson": null,
									"F_Description": null
								}, {
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "unit_code",
									"F_SettingJson": null,
									"F_Description": null
								}, {
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "unit_name",
									"F_SettingJson": null,
									"F_Description": null
								}, {
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "code",
									"F_SettingJson": null,
									"F_Description": null
								}, {
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "order_num",
									"F_SettingJson": null,
									"F_Description": null
								}, {
									"F_InfoId": "70771c742bbf772521398673eba92e9d",
									"F_Type": 0,
									"F_ResultKey": null,
									"F_OutputKey": "standard_id",
									"F_SettingJson": null,
									"F_Description": null
								}],
								"outputs": [],
								"id": "70771c742bbf772521398673eba92e9d",
								"RequestMethod": 0,
								"dataSource": ""
							}
						},
						"placeholder": "请选择单选"
					}
				};
				return config[vmodel] ? config[vmodel] : null;
			},
			
			async insertCreatedEvent() {

			},
			async insertMountedEvent() {

			},
			async insertEditEvent() {

			},
			async insertSubmitEvent() {

			},
			getFormConfig() {
				return fieldsConfig();
			},
			getFormFieldsMap() {
				return formFieldsMap();
			},
			async getHideComponentsMap() {
				let mapList = new Map();
				let hideComponentList = this.getHideComponents();
				if (typeof this.initHideComponentList == 'function') {
					mapList = await this.initHideComponentList(hideComponentList);
					this.$store.commit("SET_HIDE_COMPONENT_LIST", mapList);
				}
				return mapList;
			},
			getHideComponentsMapItem(key) {
				if (this.hideComponentsMap.size > 0) {
					return this.hideComponentsMap.has(key) ? this.hideComponentsMap.get(key) : "";
				} else {
					return ""
				}
			},
			getHideComponents() {
				return getHideComponents();
			},
		}
	}
</script>
<style>
	.el-table__empty-block {
		width: 100% !important;
	}

	.avue-form__row {
		padding: 0 !important;
	}

	#editorphone {
		width: 375px;
		margin: 0 auto;
		border: 1px solid #E4E7ED;
		padding: 0 7.5px;
		background: #f5f6fa;
		height: 700px;
		overflow-y: auto;
		overflow-x: hidden;
		border-radius: 5px;
	}

	#editorphone .el-col {
		border-bottom: 1px solid #F2F2F2;
		background: #fff;
		margin-bottom: 0;
		padding: 0 15px 6px !important;
		width: 100%;
	}

	#editorphone .el-form-item__label {
		line-height: 20px
	}

	#editorphone .el-input-group .el-input__inner {
		background: #f5f6fa
	}

	#editorphone .el-input__inner {
		border: 0
	}

	#editorphone .el-input-group__append,
	#editorphone .el-input-group__prepend {
		border: 0;
		background: #edeef2;
		color: #666;
	}

	#editorphone .el-input-group .el-input__prefix {
		left: 44px
	}

	#editorphone .el-input-group .el-input__suffix {
		right: 44px
	}

	#editorphone .el-form-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-flow: wrap;
	}

	#editorphone .el-form-item__label {
		float: none;
		min-width: 85px;
		width: auto !important;
		text-align: left;
		flex: auto;
	}

	#editorphone .tinymce .el-form-item__label {
		min-width: 100%;
	}

	#editorphone .el-form-item__content {
		margin-left: 0px !important;
		flex: auto;
		width: calc(100% - 95px);
	}

	#editorphone .avueFormNoLable .el-form-item__label,
	#editorphone .avueFormNoLable .avue-crud__pagination {
		display: none;
	}

	#editorphone .avueFormNoLable .el-collapse-item__wrap,
	#editorphone .avueFormNoLable .el-collapse {
		border-bottom: 0
	}

	#editorphone .avueFormNoLable .el-col {
		border-bottom: 0;
		padding-bottom: 0
	}

	#editorphone .el-form-item__content .el-button:first-child {
		margin-left: 90px;
	}

	.el-upload__tip {
		line-height: 1.2;
	}
</style>
